package com.ww.springboot.boot.javabase.intern;

/**
 * @author wanwei
 * @since 2021-02-05 14:55
 */
public class StringDemo3 {

    public static void main(String[] args) {

        String ss = "java";
        System.out.println(ss.intern() == ss);

        String ss1 = "ja"+"va";
        System.out.println(ss1.intern() == ss1);

        String ss2 = new String("java");
        System.out.println(ss2.intern() == ss2);

        String ss3 = new String("ja"+"va");
        System.out.println(ss3.intern() == ss3);


    }
}
